import { FieldType } from 'choerodon-ui/pro/lib/data-set/enum';

function handleDataSetChange({ value, oldValue }: { value: Date, oldValue: Date }) {
  console.log('[range dataset newValue]', value, '[oldValue]', oldValue);
}

const timePickerDs = () => ({
  autoCreate: true,
  fields: [
    {
      name: 'time',
      type: FieldType.time,
      format: 'hh:mm:ss A',
    },
    {
      name: 'time2',
      type: FieldType.time,
      format: 'HH:mm',
    },
    {
      name: 'time3',
      type: FieldType.time,
      format: 'hh:mm:ss',
    },
    {
      name: 'time4',
      type: FieldType.time,
      format: '现在时间：HH:mm',
    },
  ],
  events: {
    update: handleDataSetChange,
  },
});

export default timePickerDs;